import {
  HTTP
} from '../utils/http.js'

class UserHttp extends HTTP {
  // 获取用户信息
  getUserInfo() {
    return this.request({
      url: 's/userinfo/UserInfo',
      method: 'POST',
      isShowLoading: false
    })
  }

  // 获取账号绑定客如云用户余额
  getKryBlance(data) {
    return this.request({
      url: 's/lottery/KryBlance',
      method: 'POST',
      data: data,
      isShowLoading: false
    })
  }

  // 获取用户余额流水
  getMemberBalanceBill(data) {
    return this.request({
      url: 's/userinfo/CardLog',
      method: 'POST',
      data
    })
  }

  // 绑定服务中心
  bindServiceCenter(data) {
    return this.request({
      url: 's/userinfo/BindService',
      method: 'POST',
      data: data,
      isShowLoading: false
    })
  }

  // // 绑定门店店铺
  // bindStore(data) {
  //   return this.request({
  //     url: 's/userinfo/BindStore',
  //     method: 'POST',
  //     data
  //   })
  // }

  userAddAddr(data) {
    return this.request({
      url: 's/userinfo/AddAddr',
      method: 'POST',
      data: data
    })
  }


  // 获取订单信息
  getOrderDetailr(data) {
    return this.request({
      url: 'order/getOrderDetail',
      method: 'POST',
      data: data,
      isJavaRequest: true
    })
  }

  // 取消订单
  getOrderOff(data) {
    return this.request({
      url: 'order/orderOff',
      method: 'POST',
      data: data,
      isJavaRequest: true
    })
  }

  // 订单退款 部分退款
  getOrderRefund(data) {
    return this.request({
      url: 'order/refund',
      method: 'POST',
      data: data,
      isJavaRequest: true
    })
  }

  // 申请售后
  getOrderAfterSale(data) {
    return this.request({
      url: 'order/afterSale',
      method: 'POST',
      data: data,
      isJavaRequest: true
    })
  }

  // 订阅消息
  wxmsgTplSubscribe(data) {
    return this.request({
      url: 's/wxmsg/TplSubscribe',
      method: 'POST',
      data: data
    })
  }

  //获取模板id
  getRecharMsgList(data) {
    return this.request({
      url: 's/wxmsg/GetRecharMsgList',
      method: 'POST',
      data: data
    })
  }

  //获取中了这个 奖品的人
  getRedGooodsUsers(data) {
    return this.request({
      url: 'lottery/GetRedGooodsUsers',
      method: 'POST',
      data: data
    })
  }
  //分单退款
  partAfterSale(data) {
    return this.request({
      url: 'order/partAfterSale',
      method: 'POST',
      data: data,
      isJavaRequest: true
    })
  }
  //点击我也要免单时调用
  jlKnifeOrder(data) {
    return this.request({
      url: 's/luckdraw/JlKnifeOrder',
      method: 'POST',
      data: data
    })
  }
  //分享落地页UV
  ShareView(data) {
    return this.request({
      url: 's/lottery/ShareView',
      method: 'POST',
      data: data,
      isShowerrMsg: false,
      isTempToken: true,
      isShowLoading: false
    })
  }
  //新任务UV
  UserUv(data) {
    return this.request({
      url: 's/luckdraw/UserUv',
      method: 'POST',
      data: data,
      isShowLoading: false,
      isShowerrMsg: false
    })
  }

  // 积分兑换列表
  integralExchange() {
    return this.request({
      url: 's/yddgoods/CostGiftList',
      method: 'POST'
    })
  }

  // 积分领取奖励
  costGiftRecv(data) {
    return this.request({
      url: 's/yddgoods/CostGiftRecv',
      method: 'POST',
      data: data
    })
  }

  // 团长数据
  inviterSum(data) {
    return this.request({
      url: 'report/inviter/month/sum',
      method: 'POST',
      isJavaRequest: true,
      data: data
    })
  }

}

export {
  UserHttp
}
